<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
<head>
    <th:block th:include="include :: header('建档项目库')" />
</head>
<body class="gray-bg">
     <div class="container-div">
        <div class="row">
            <div class="col-sm-12 search-collapse">
                <form id="formId">
                    <div class="select-list">
                        <ul>
                            <li>
                                <p>关键字：</p>
                                <input type="text" name="keyword"/>
                            </li>
                            <li>
							项目类型：<select name="projectType" th:with="type=${@dict.getType('sys_normal_disable')}">
							            <option value="">全部</option>
										<option value="房建">房建</option>
										<option value="市政">市政</option>
								   </select>
								</li>  
                            <li>
                            <li>
								<label>总金额： </label>
								<input style="width:100px" type="text" name="beginProjectCost" placeholder="最小总金额"/>
								<span>-</span>
								<input style="width:105px" type="text" name="endProjectCost" placeholder="最大总金额"/>
							</li>
                            <li>
								<label>总规模： </label>
								<input style="width:100px" type="text" name="beginTotalArea" placeholder="最小规模"/>
								<span>-</span>
								<input style="width:105px" type="text" name="endTotalArea" placeholder="最大规模"/>
							</li>
							<!-- 目前暂缺 -->
							<!-- <li>
							行政主管部门：<select name="projecttype" th:with="type=${@dict.getType('sys_normal_disable')}">
							            <option value="">全部</option>
										<option value="">陵水黎族自治县住房和城乡建设局</option>
										<option value="">陵水黎族自治县行政审批服务局</option>
								   </select>
							</li> --> 
                            <li>
							项目状态：<select name="projectState" th:with="type=${@dict.getType('sys_normal_disable')}">
							            <option value="">全部</option>
										<option value="在建">在建</option>
										<option value="已竣工备案">竣工</option>
										<!-- <option value="">取消</option> -->
								   </select>
								</li> 
							<li class="select-time">
                                <p>建档时间：</p>
                                <input type="text" class="time-input" id="startTime" placeholder="开始时间" name="beginPubDate"/>
                                <span>-</span>
                                <input type="text" class="time-input" id="endTime" placeholder="结束时间" name="endPubDate"/>
                            </li> 
                            <li>
                                <a class="btn btn-primary btn-rounded btn-sm" onclick="$.table.search()"><i class="fa fa-search"></i>&nbsp;搜索</a>
                                <a class="btn btn-warning btn-rounded btn-sm" onclick="$.form.reset()"><i class="fa fa-refresh"></i>&nbsp;重置</a>
                            </li>
                        </ul>
                    </div>
                </form>
            </div>
            <div class="col-sm-12 select-table table-striped">
                 <table id="bootstrap-table"></table>
            </div>
        </div>
    </div>
    <th:block th:include="include :: footer" />
    <script th:inline="javascript">
    var prefix = ctx + "projectArchives/projectArchives";
    
    $(function() {
    	 var options = {
    			url: prefix + "/list",
                createUrl: prefix + "/add",
                updateUrl: prefix + "/edit/{id}",
                removeUrl: prefix + "/remove",
                exportUrl: prefix + "/export",
                detailUrl: prefix + "/detail/{id}",
                modalName: "项目",
                columns: [{
                        field: 'id',
                        title: '序号',
						formatter: function (value, row, index) {
						
						    return index + 1;
						}
                    },
                    {
                        field: 'guid',
                        title: '项目编码',
						visible: false
	                }, 
					{
                        field: 'projectName',
                        title: '项目名称',
                        formatter: function (value, row, index) {
                            var actions = [];
                            /* actions.push('<a href="'+prefix+'/detail?guid='+row.guid+'">'+value+'</a>');  */
							actions.push('<a href="javascript:void(0)" onclick="$.operate.detailQYTabRewrite(\'' + row.guid + '\',\''+ value +'\')">'+value+'</a> ');
                            return actions.join('');
                        }
                    },
                    {
                        field: 'projectCityNum',
                        title: '市县'
                    },
                    {
                        field: 'constructUnitId',
                        title: '建设单位'
                    },
                    {
                        field: 'totalArea',
                        title: '总规模(㎡)',
						formatter: function (value, row, index) {
                            if($.common.isNotEmpty(value)){
								value = Number(value).toFixed(2);
							} 
                            return value;
                        }
                    },
                    {
                        field: 'projectCost',
                        title: ' 总金额(万)',
						formatter: function (value, row, index) {
                            if($.common.isNotEmpty(value)){
								value = Number(value).toFixed(2);
							} 
                            return value;
                        }
                    },
                    {
                        field: 'projectAddress',
                        title: '项目地址'
                    }]
        };
    	$.table.init(options);
    });
    </script>
</body>
</html>